import { _decorator, Animation } from 'cc'
import { IRON_SKULL_STATE, IronSkullStateMachine } from './IronSkullStateMachine'
import { Role } from '../../Base/Role'
const { ccclass, property } = _decorator

@ccclass('IronSkullController')
export class IronSkullController extends Role {
  //人物当前的位置
  x: number = 6
  y: number = 5

  _fsm: IronSkullStateMachine = null

  init() {
    console.log('IronSkullController init')
    //创建人物精灵
    this.createRoleSprite()
    //初始化状态机
    this._fsm = new IronSkullStateMachine(this.getComponent(Animation))
    this._fsm.stateName = IRON_SKULL_STATE.IDLE_LEFT
  }
}
